package com.example.moviepro.service.impl;

import com.example.moviepro.entity.Comment;
import com.example.moviepro.mapper.CommentMapper;
import com.example.moviepro.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentServiceimpl implements CommentService {
    @Autowired
    private CommentMapper commentMapper;
    @Override
    public void addComment(Comment comment) {
        commentMapper.addComment(comment);
    }

    @Override
    public List<Comment> getCommentsByMovieId(int movieId) {
        return commentMapper.getCommentsByMovieId(movieId);
    }

    @Override
    public int findCommentId(Comment comment) {
        return commentMapper.findCommentId(comment);
    }

    @Override
    public Comment findCommentById(int id) {
        return commentMapper.findCommentById(id);
    }

    @Override
    public void deleteComment(int id) {
        commentMapper.deleteComment(id);
    }
}
